$(function () {
    selectHeadFoot();
})
function selectHeadFoot() {
    let data = myAjax("/headandfoot","","get");
    let model = data.model;
    let list = data.list;
    $("#titles").text(model.title);
    $("#englishtitle").text(model.englishtitle);
    $("#foothref").text(model.foothref);
    $("#footwords").text(model.footwords);

    $("#photo").attr('src',"/back/img/"+model.photo);
    $("#titles1").text(model.title);
    $("#englishtitle1").text(model.englishtitle);

    let html = '';
    for (let i = 0;i<list.length;i++){
        html+='<div><a id="title'+i+'" href="'+list[i].href+'" onclick="changeColor('+i+','+list.length+')">'+list[i].title+'</a></div>'
    }
    $("#headlink").html(html);
}
// function changeColor(i,t) {
//     for (let n = 0;n<t;n++){
//         $("#title"+n+"").css("color","black");
//     }
//     $("#title"+i+"").css("color","#0accce");
//
// }